package com.fy.ktorm.controller

import com.fy.ktorm.dao.Departments
import me.liuwj.ktorm.dsl.eq
import me.liuwj.ktorm.entity.findOne
import org.springframework.stereotype.Controller
import org.springframework.ui.ModelMap
import org.springframework.web.bind.annotation.RequestMapping


@Controller
class HomeController {
    @RequestMapping("/home")
    fun home() : String{
        return "home.html"
    }
    @RequestMapping("/deptest")
    fun deptest(map: ModelMap) : String{
        val dep = Departments.findOne { it.name eq "tech" }
        map.addAttribute("dep",dep)
        return "home.html"
    }
}